<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>共享设置 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../head.html"/>
<script type="text/javascript">
$().ready(function() {
	<#if success??>
		$.message("success", "设置成功");
	</#if>
	
	var $inputForm = $("#inputForm");

	var $selectAll = $("#inputForm .selectAll");
	$selectAll.click(function() {
		var $this = $(this);
		var $thisCheckbox = $this.closest("tr").find(":checkbox");
		if ($thisCheckbox.filter(":checked").size() > 0) {
			$thisCheckbox.prop("checked", false);
		} else {
			$thisCheckbox.prop("checked", true);
		}
		return false;
	});

	var shares = [<#list role.shares as p>"${p}"<#if p_has_next>,</#if></#list>];
	var roleId = ${role.id};
	$("#inputForm input[name=ext]").each(function() {
		var share = $(this).val();
		
		for(var i=0,len=shares.length;i<len;i++) {
			if(shares[i]==share) {
				$(this).attr("checked",true);
				break;
			}
		}
	});
		
});
</script>
<style type="text/css">
.authorities label {
	min-width: 100px;
	_width: 100px;
	display: block;
	float: left;
	padding-right: 4px;
	_white-space: nowrap;
}
</style>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 共享设置 &raquo; ${role.name!}
	</div>
	<form id="inputForm" action="o_save.jspx" method="post">
		<input type="hidden" name="id" value="${role.id!}"/>
		<table class="input">
			<tr class="authorities">
				<th>
					<a title="全选" class="selectAll" href="javascript:;"><span class="blue">[全选]</span>${role.name!}</a>
				</th>
				<td>
					<span class="fieldSet">
						<#list exts?keys as extKey>  
							<#assign extValue=exts[extKey] >  
							<label><input type="checkbox"  name="ext"  value="${extKey}" title="勾选此选项，此角色可以看到${extValue}的数据" />${extValue}</label>
						</#list>  
					</span>
				</td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定" />
				</td>
			</tr>
		</table>
	</form>
	<#include "../footer.html"/>
</body>
</html>